
import React, { useState } from 'react';
import { Modal, Button } from 'antd';
import { ButDiv } from './style'


const Index = () => {
    const [isModalVisible, setIsModalVisible] = useState(false);
    const [data , setData] = useState(false)
    const showModal = () => {

        setIsModalVisible(true);
    };
    const handleOk = () => {
        setIsModalVisible(false);
    };

    const handleCancel = () => {
        setIsModalVisible(false);
    };

    return (
        <ButDiv>
            
                {
                    data === true?<Button>审核通过</Button>
                    :<Button type="primary" onClick={showModal}>审核</Button>
                }
            
            <Modal className='modals' title="审核" okText='确定' cancelText='取消' visible={isModalVisible} onOk={handleOk} onCancel={handleCancel}>
                <Button className='buttonName' style={{marginLeft:'100px'}} onClick={
            ()=>{setData(true)}                }>审核成功</Button>
                <Button type="dashed"style={{marginLeft:'40px'}} onClick= {()=>{setData(false)}}>审核失败</Button>
            </Modal>
        </ButDiv>
    );
}

export default Index;

